#include <stdio.h>

int v[100] = {0};
int p[100] = {0};

int v_p[4][100] = {0};
int v_p_cnt[4] = {0};

int main()
{
	int n = 0, w = 0;
	scanf("%d %d", &n, &w);
	int minV = 0x7FFFFFFF;
	for ( int i = 0; i < n; i++ ) {
		scanf("%d %d", &v[i], &p[i]);
		if ( minV > v[i] ) {
			minV = v[i];
		}
	}
	
	for ( int i = 0; i < n; i++ ) {
		int idx =  v[i] - minV;
		v_p[idx][v_p_cnt[idx]++] = p[i];
	}
	
	for ( int i = 0; i < v_p_cnt[0]; i++) {
		for ( int j = 0; j < v_p_cnt[1])
	}
	
	return 0;
} 
